public class TemplateTest {
    public static void main(String[] args) {
        aba a1 = new aba();
        a1.spendtime();
    }
}
abstract class Template{
    public void spendtime(){
        long start = System.currentTimeMillis();
        code();
        long end = System.currentTimeMillis();
        System.out.println("花费了多少时间"+(end-start));

    }
    public abstract void code();
}
class aba extends Template{
    @Override
    public void code() {
        for (int i = 2; i <1000 ; i++) {
            boolean iszhishu=true;
            for (int j = 2; j <Math.sqrt(i) ; j++) {
                if(i%j==0){
                    iszhishu=false;
                    break;
                }
                if(iszhishu){
                    System.out.println(i);
                }
            }
        }
    }
}